//
//  PublicNumberViewController.m
//  LOU
//
//  Created by iMacOne on 15/11/6.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "PublicNumberViewController.h"
#import "Size.h"
#import "ToolUtil.h"
#import "QRCodeGenerator.h"
#import "ScanQRViewController.h"
@interface PublicNumberViewController ()
@property (nonatomic, strong)UIImageView * QRCodeImageView;

@end

@implementation PublicNumberViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController.tabBar.hidden = YES;
    [ToolUtil createLine:margin_64 superView:self.view lift:0 width:WindowWidth hight:0.5 color:[UIColor grayColor]];

    [self createTitle:@"我的" midTitle:@"微信公众号"];
    
    self.QRCodeImageView = [[UIImageView alloc] initWithFrame:CGRectMake((WindowWidth - WindowWidth / 3)/2, margin_140, WindowWidth / 3, WindowWidth / 3)];
    _QRCodeImageView.image = [QRCodeGenerator qrImageForString:@"uuu" imageSize:_QRCodeImageView.frame.size.width];
//    _QRCodeImageView.image = [UIImage imageNamed:@"QRCode"];
    
    UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake((WindowWidth - margin_160) /2, 300, margin_160, margin_34);
    button.backgroundColor = [UIColor blackColor];
    [button setTitle:@"扫一扫" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(doClickBtn) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
//    _aImageView.backgroundColor = DEBUG_CLOLR;
    
    [self.view addSubview:_QRCodeImageView];
    // Do any additional setup after loading the view.
}
- (void)doClickBtn
{
    ScanQRViewController * scanControl = [[ScanQRViewController alloc] init];
    scanControl.delegate = self;
    [self jump:@"" to:scanControl];
    
}
// 处理扫描结果
-(void)scanResult:(NSString*)result {
    
    [super scannerResult:result];
    
}
@end
